package cn.taobaoke.restful.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * RobotEntity类.
 * +-----------------------------------------------------------------------------------------------+
 * |类名称: RobotEntity                                                                         |
 * |创建时间: 3/18/17                                                                               |
 * |功能简介:                                                                                       |
 * |参考链接:                                                                                       |
 * +-----------------------------------------------------------------------------------------------+
 *
 * @author luch
 */
@ToString
@Setter
@Getter
@Entity
@Table(name = "tb_robot")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RobotEntity implements Serializable {

    @Id
    @GeneratedValue
    private Long id;

    @Column
    private String type;            // 机器人类型  sender_robot, collector_robot, alimama_robot, center_robot, agent_robot

    @Column
    private String name;            // 记得唯一名字进行区分

    @Column
    private String host;

    @Column
    private String ip;

    @Column
    private String state;           // 机器人状态: ready, running, warn, error, stop, close

    @Column
    private String message;


    // alimama_robot attrs
    @Column
    private String alimama;             // 阿里妈妈账号

    @Column
    private String aliPassword;         // 阿里妈妈密码
    // @end  alimama_robot attrs


    // sender_robot attrs
    @Column
    private String weChat;              // 返单微信号


    @Column(length = 1000)
    private String sendGroups;          // 发单群, 多个群之间用逗号隔开
    // @end sender_robot robot


    // agent_robot
    //@end agent_robot

    // center_robot
    // @Column private String weChat;   // 微信账号, 前面已经有了
    // @end robot

    // agent_robot
    // @end agent_robot

    @Column
    private Date createAt;

    @Column
    private Date updateAt;

    @Column
    private Long domainId;
}
